﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Manager/Views/Shared/ManagerLayout.cshtml";
}

<title>新增文章 - 资讯管理 - H-ui.admin v3.1</title>
    <article class="page-container">
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <span class="l">
                <a class="btn btn-primary radius" data-title="公告列表" data-href="/Manager/Notice/Index" href="/Manager/Notice/Index"><i class="Hui-iconfont">&#xe100;</i> 公告列表</a>
            </span>
        </div>
        <form class="form form-horizontal" id="form1">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章标题：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="请输入文章标题" required id="Title" name="Title">
                </div>
            </div>
          
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">排序值：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="0" placeholder="排序" id="Sort" name="Sort">
                </div>
            </div>
           
           
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">文章作者：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="公司" placeholder="作者" id="Author" name="Author">
                </div>
            </div>
 
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">文章内容：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <script id="editor" name="Ncontent" type="text/plain" style="width:100%;height:400px;">
                    </script>
                </div>
            </div>
            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                    <button  class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交</button>
                </div>
            </div>
        </form>
    </article>

<!--请在下方写此页面业务相关的脚本-->
<script src="~/DirectSellJs/manager/lib/ueditor/ueditor.config.js"></script>
<script src="~/DirectSellJs/manager/lib/ueditor/ueditor.all.min.js"></script>
<script src="~/DirectSellJs/manager/lib/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
$(function(){
	var ue = UE.getEditor('editor');
});
$('#form1').on('submit', function () {
    formPost()
    event.preventDefault() //阻止form表单默认提交
})
function formPost() {
    //加载层
    var index = layer.load(1, {
        shade: [0.1, '#fff']
    });
    $.ajax({
        type: "post",
        url: "/Manager/NoticeAdd/Add",
        data: $('#form1').serialize(),
    }).success(function (message) {
        layer.msg('发布成功', { icon: 1 });
    }).fail(function (err) {
        console.log(err);
        layer.msg('系统错误,请稍后重试!', { icon: 2 });
    })
    layer.close(index)//关闭加载层
}
</script>
